/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
.search-container {
  height: 100%;
  overflow-y: hidden;
}

.theme-dark .search-container {
  --search-result-background-hover: rgba(53, 59, 72, 1);
}

.project-text-search {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-y: hidden;
  height: 100%;
}

.project-text-search .result {
  display: contents;
  cursor: default;
  line-height: 16px;
  font-size: 11px;
  font-family: var(--monospace-font-family);
}

.project-text-search .result:hover > * {
  background-color: var(--search-result-background-hover);
}

.project-text-search .result .line-value {
  grid-column: 2;
  padding-block: 1px;
  padding-inline-end: 4px;
  text-overflow: ellipsis;
  overflow-x: hidden;
}

.project-text-search .result .query-match {
  border-bottom: 1px solid var(--theme-contrast-border);
  color: var(--theme-contrast-color);
  background-color: var(--theme-contrast-background);
}

.project-text-search .result.focused .query-match {
  border-bottom: none;
  color: var(--theme-selection-background);
  background-color: var(--theme-selection-color);
}

.project-text-search .no-result-msg {
  color: var(--theme-text-color-inactive);
  font-size: 24px;
  padding: 4px 15px;
  max-width: 100%;
  overflow-wrap: break-word;
  hyphens: auto;
}

.project-text-search .file-result {
  grid-column: 1/3;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 24px;
  padding: 2px 4px;
  font-weight: bold;
  font-size: 12px;
  line-height: 16px;
  cursor: default;
}

.project-text-search .file-result .img {
  margin-inline: 2px;
}

.project-text-search .file-result .img.file {
  margin-inline-end: 4px;
}

.project-text-search .file-path {
  flex: 0 1 auto;
  padding-inline-end: 4px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-text-search .file-path:empty {
  display: none;
}

.project-text-search .search-field {
  display: flex;
  align-self: stretch;
  flex-grow: 1;
  width: 100%;
  border-bottom: none;
}

.project-text-search .managed-tree {
  overflow-y: auto;
  height: 100%;
}

.project-text-search .managed-tree .tree {
  height: 100%;
  display: block;
  /* Align the second column to the search input's text value */
  overflow-x: hidden;
  padding-top: 4px;
}

/* Focus values */

.project-text-search .file-result.focused,
.project-text-search .result.focused .line-value,
.project-text-search .result.focused .line-number {
  color: var(--theme-selection-color);
  background-color: var(--theme-selection-background);
}

.project-text-search .file-result.focused .img {
  background-color: currentColor;
}
